<%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>FB like counter</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/css/main.css"/>"/>
</head>
<body>
<div class="header">
    <a href="<c:url value="/signout" />">Sign Out</a>
</div>

<div style="width: 30%; float:left" class="left">

    <h3><c:out value="${name}"/> Facebook Friends</h3>
    <ul>
        <c:forEach items="${friends}" var="friend">
            <li>
                <a href="<c:out value="/user/${friend.id}"/>">
                    <img src="http://graph.facebook.com/<c:out value="${friend.id}"/>/picture" align="middle"/>
                    <c:out value="${friend.name}"/>
                </a>
            </li>
        </c:forEach>
    </ul>
</div>

<div style="width: 70%; float:right" class="right">

    <span class="<c:out value="${actionResultStyle}"/>"><c:out value="${actionResult}"/></span>

    <div>
        <form method="POST" action="<c:url value="/postStatus"/>">
            <textarea cols="50" rows="8" name="text" id="text"></textarea>
            <button type="submit">Post!</button>
        </form>
    </div>

    <div>
        <h3><c:out value="${name}"/> words statistics</h3>

        <FORM>
            <INPUT TYPE="button" onClick="history.go(0)" VALUE="Refresh">
        </FORM>

        <table border="0" class="wordTable">
            <c:forEach items="${words}" var="word">
                <tr>
                    <td><c:out value="${word.key}"/></td>
                    <td><c:out value="${word.count}"/></td>
                </tr>
            </c:forEach>
        </table>
    </div>
</div>
</body>
</html>